package com.hytc.mymall.utils;

import android.content.Context;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

public class ViewHolder
{
  private View mConvertView;
  private int mPosition;
  private SparseArray<View> mViews = new SparseArray();
  
  public ViewHolder(Context paramContext, ViewGroup paramViewGroup, int paramInt1, int paramInt2)
  {
    this.mPosition = paramInt2;
    this.mConvertView = LayoutInflater.from(paramContext).inflate(paramInt1, paramViewGroup, false);
    this.mConvertView.setTag(this);
  }
  
  public static ViewHolder get(Context paramContext, View paramView, ViewGroup paramViewGroup, int paramInt1, int paramInt2)
  {
    if (paramView == null) {
      return new ViewHolder(paramContext, paramViewGroup, paramInt1, paramInt2);
    }
    ViewHolder localViewHolder = (ViewHolder)paramView.getTag();
    localViewHolder.mPosition = paramInt2;
    return localViewHolder;
  }
  
  public View getConvertView()
  {
    return this.mConvertView;
  }
  
  public <T extends View> T getView(int paramInt)
  {
    View localView = (View)this.mViews.get(paramInt);
    if (localView == null)
    {
      localView = this.mConvertView.findViewById(paramInt);
      this.mViews.put(paramInt, localView);
    }
    return (T) localView;
  }
  
  public ViewHolder setText(int paramInt, String paramString)
  {
    ((TextView)getView(paramInt)).setText(paramString);
    return this;
  }
  
  public ViewHolder setdrawbale(int paramInt1, int paramInt2)
  {
    ((ImageView)getView(paramInt1)).setImageResource(paramInt2);
    return this;
  }
}



/* Location:           C:\Users\Joker\Desktop\classes_dex2jar.jar

 * Qualified Name:     com.sz.ydgy.utils.ViewHolder

 * JD-Core Version:    0.7.0.1

 */